Skip to content

fix(invitations): inert referrals state when public signup is open#4306

Merged
PierreBrisorgueil merged 2 commits into
masterfrom
fix/3833-referrals-open-signup-state
Jun 13, 2026
Merged

fix(invitations): inert referrals state when public signup is open#4306
PierreBrisorgueil merged 2 commits into
masterfrom
fix/3833-referrals-open-signup-state

Conversation

@PierreBrisorgueil

Copy link
Copy Markdown
Collaborator

Summary

  • What changed: The account Referrals view now detects open public signup (serverConfig.sign.up === true) and replaces the invite form with an informational state, keeping the My-referrals list read-only. On closed signup nothing changes.
  • Why: The server never claims/finalizes an invite token while public signup is open, so soliciting invites there was a dead end — the UI was presenting a broken flow to the user.
  • Related issues: Refs pierreb-devkit/Node#3833

Scope

  • Modules impacted: src/modules/invitations/
  • Cross-module impact: none
  • Risk level: low

Validation

  • npm run lint
  • npm run test:unit
  • npm run build
  • Manual checks done (if applicable)

Guardrails check

  • No secrets or credentials introduced (.env*, secrets/**, keys, tokens)
  • No risky rename/move of core stack paths
  • Changes remain merge-friendly for downstream projects
  • Tests added or updated when behavior changed

Optional: Infra/Stack alignment details

Delete this section if not applicable.

Before vs After (key changes only)

Area Before After Notes
Referrals view (signup open) Invite form shown (dead-end — server ignores invites) Informational inert state shown serverConfig.sign.up === true guard
Referrals view (signup closed) Invite form shown Invite form shown (unchanged) No behaviour change
My-referrals list Always visible Always read-only visible No behaviour change
  • Upstream parity target / source: cross-repo Vue half of pierreb-devkit/Node#3833
  • Automation or policy impact (CI, Dependabot, auto-merge, majors, permissions): none
  • Rollback plan: revert single commit 7e7b356f

Notes for reviewers

  • Security considerations: none — purely presentational guard on a client-side config value already exposed via /server-config endpoint
  • Mergeability considerations: none
  • Follow-up tasks: downstream propagation via /update-stack on consumer projects after both Node#3833 and this PR are merged

Test plan

  • invitations.account.view unit suite 20/20 (signup-open inert state, signup-closed form shown, unknown-config safe-default, list read-only)

Refs pierreb-devkit/Node#3833

The server never claims/finalizes an invite token while public signup
is open, so the account Referrals tab solicited invites that could
never convert. When the public auth config reports sign.up true the
invite form is replaced by an informational alert; the My-referrals
list stays visible read-only. Unknown/missing server config keeps the
form (backend policy is the real gate). refs pierreb-devkit/Node#3833
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@PierreBrisorgueil, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 17 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e0c1b2fb-dbc7-41a0-a51b-02a5081e28c9

📥 Commits

Reviewing files that changed from the base of the PR and between 26805f3 and 34808cf.

📒 Files selected for processing (2)
  • src/modules/invitations/tests/invitations.account.view.unit.tests.js
  • src/modules/invitations/views/invitations.account.view.vue
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/3833-referrals-open-signup-state

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@PierreBrisorgueil PierreBrisorgueil marked this pull request as ready for review June 13, 2026 07:11
Copilot AI review requested due to automatic review settings June 13, 2026 07:11
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.58%. Comparing base (d203d84) to head (34808cf).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4306   +/-   ##
=======================================
  Coverage   99.58%   99.58%           
=======================================
  Files          32       32           
  Lines        1219     1219           
  Branches      360      360           
=======================================
  Hits         1214     1214           
  Misses          5        5           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PierreBrisorgueil

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the invitations module’s account “Referrals” view to avoid presenting a broken invite/referral flow when the deployment has public signup enabled (per authStore.serverConfig.sign.up), replacing the invite form with an informational inert state while keeping the referrals list visible/read-only.

Changes:

  • Add a signupOpen computed flag sourced from useAuthStore().serverConfig.sign.up and conditionally render an info alert instead of the invite form.
  • Add unit tests covering signup-open vs signup-closed rendering, plus null/unknown config fallback.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/modules/invitations/views/invitations.account.view.vue Adds signupOpen guard and an informational alert to disable the invite form when public signup is open.
src/modules/invitations/tests/invitations.account.view.unit.tests.js Mocks useAuthStore() and adds tests for the new open-signup inert UI state and safe defaults.

Comment thread src/modules/invitations/views/invitations.account.view.vue Outdated
…mputed

Rephrase "Strict === true" (read as an undefined config flag) to explicit
"Uses strict equality (=== true)" wording — no behaviour change.
@PierreBrisorgueil PierreBrisorgueil merged commit b1cb7d5 into master Jun 13, 2026
7 checks passed
@PierreBrisorgueil PierreBrisorgueil deleted the fix/3833-referrals-open-signup-state branch June 13, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants